package com.gxa.springboot229.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 优惠劵
 */

@Data
@NoArgsConstructor
@AllArgsConstructor

// 利用JPA的注解关联user表
@Table(name="ticket")
public class Ticket implements Serializable {
    @Id
    @Column(name = "tkt_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)   // 设置id主键的策略为IDENTITY,作为自动增长策略
    private Integer id;
    @Column(name = "tkt_name")
    private String name;
    @Column(name = "tkt_desc")
    private String desc;
    @Column(name = "tkt_text")
    private String role;
    @Column(name = "tkt_collectExpire")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date collectExpire;
    @Column(name = "tkt_useExpire")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date useExpire;
    @Column(name = "tkt_img")
    private String img;
    @Column(name = "tkt_state")
    private Boolean state;// 上下架

}
